﻿using Sabloane_de_proiectare.Command;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;

namespace Sabloane_de_proiectare
{
    public  class Container : StackPanel
    {
        public int Row { get; set; }
        public int Column { get; set; }
        public Container() { }
        public Container(int Row, int Column) {
            //set BG color
            this.Background = new SolidColorBrush(Colors.Azure);
            //set Dimensions
            this.Width = 50;
            this.Height = 50;
            //set Alignment
            this.HorizontalAlignment = HorizontalAlignment.Center;
            this.VerticalAlignment = VerticalAlignment.Center;
            //attach the static methods from Grid class to the current element, and set them
            Grid.SetRow( this, Row);
            Grid.SetColumn(this, Column);
            //set the private members
            this.Row = Row;
            this.Column = Column;
            //this.Children.Add(new TopRightTurnRail());
            }
    
        public Type getCurrentChild()
        {
            if (this.Children.Count != 0 )
                return this.Children.ElementAt(0).GetType();
            return null;
        }

        public int setChildren(Canvas target, int childrenType)
        {
            removeChild();
            this.Children.Add(target);
            return childrenType;
        }
        public void removeChild()
        {
            this.Children.Clear();
        }
    }
}
